<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/moment.js/2.29.1/moment.js"></script>
</head>
<body>
    <script>
        var fun1 = function() {
            console.log(Math.random());
        }
        fun1();

        // 2020-12-25
        // 2020/12/25
        // 手写js
        // 第三方库moment
        function fun2(val) {
            var date_ = moment(new Date()).format('YYYY/MM/DD HH:mm:ss');

            console.log(date_);
            // 获取当前时间
            console.log(new Date());
            // 获取时间戳
            console.log(new Date().getTime());
            console.log(val);
        }
        fun2('hello world');

    </script>
</body>
</html>